package com.zhihaihe.file.advice;

import com.zhihaihe.file.util.ResultCodeEnum;
import lombok.Data;

/**
 * 自定义全局异常类
 * @author
 */
@Data
public class CommonException extends  RuntimeException{
    private Integer code;

    public CommonException(String message,Integer code) {
        super(message);
        this.code = code;
    }

    public CommonException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }
}
